package com.maidou.qiantai.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.maidou.qiantai.mapper.OsOrderReturnApplyMapper;
import com.maidou.qiantai.domain.OsOrderReturnApply;
import com.maidou.qiantai.service.IOsOrderReturnApplyService;

/**
 * 订单退货申请Service业务层处理
 * 
 * @author maidou
 * @date 2024-03-15
 */
@Service
public class OsOrderReturnApplyServiceImpl implements IOsOrderReturnApplyService 
{
    @Autowired
    private OsOrderReturnApplyMapper osOrderReturnApplyMapper;

    /**
     * 查询订单退货申请
     * 
     * @param id 订单退货申请主键
     * @return 订单退货申请
     */
    @Override
    public OsOrderReturnApply selectOsOrderReturnApplyById(Long id)
    {
        return osOrderReturnApplyMapper.selectOsOrderReturnApplyById(id);
    }

    /**
     * 查询订单退货申请列表
     * 
     * @param osOrderReturnApply 订单退货申请
     * @return 订单退货申请
     */
    @Override
    public List<OsOrderReturnApply> selectOsOrderReturnApplyList(OsOrderReturnApply osOrderReturnApply)
    {
        return osOrderReturnApplyMapper.selectOsOrderReturnApplyList(osOrderReturnApply);
    }

    /**
     * 新增订单退货申请
     * 
     * @param osOrderReturnApply 订单退货申请
     * @return 结果
     */
    @Override
    public int insertOsOrderReturnApply(OsOrderReturnApply osOrderReturnApply)
    {
        osOrderReturnApply.setCreateTime(DateUtils.getNowDate());
        return osOrderReturnApplyMapper.insertOsOrderReturnApply(osOrderReturnApply);
    }

    /**
     * 修改订单退货申请
     * 
     * @param osOrderReturnApply 订单退货申请
     * @return 结果
     */
    @Override
    public int updateOsOrderReturnApply(OsOrderReturnApply osOrderReturnApply)
    {
        osOrderReturnApply.setUpdateTime(DateUtils.getNowDate());
        return osOrderReturnApplyMapper.updateOsOrderReturnApply(osOrderReturnApply);
    }

    /**
     * 批量删除订单退货申请
     * 
     * @param ids 需要删除的订单退货申请主键
     * @return 结果
     */
    @Override
    public int deleteOsOrderReturnApplyByIds(Long[] ids)
    {
        return osOrderReturnApplyMapper.deleteOsOrderReturnApplyByIds(ids);
    }

    /**
     * 删除订单退货申请信息
     * 
     * @param id 订单退货申请主键
     * @return 结果
     */
    @Override
    public int deleteOsOrderReturnApplyById(Long id)
    {
        return osOrderReturnApplyMapper.deleteOsOrderReturnApplyById(id);
    }
}
